﻿using System;

namespace PoolKit.Extensions
{
    internal static class ExceptionExtensions
    {
        /// <summary>
        /// </summary>
        /// <remarks>This is a fairly controversal thing. Not one of the best practices, definitely.</remarks>
        /// <param name="exception"></param>
        /// <returns></returns>
        public static bool IsNotWrappable(this Exception exception)
        {
            if (exception == null)
            {
                return false;
            }

            return ((exception is StackOverflowException) || (exception is OutOfMemoryException));
        }
    }
}